home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-2.iso
/
os2
/
gnucal.zip
/
configure.in
< prev
next >
Wrap
Text File
|
1995-12-09
|
23KB
|
808 lines
dnl Process this file with autoconf to produce a configure script for gcal
dnl
dnl Starting operations.
dnl
AC_INIT(gcal_def.h)dnl
AC_CONFIG_HEADER(gcal_cfg.h)dnl
AC_PREREQ(2.1)dnl
AC_REVISION($Id: configure.in 2.4 1995/12/09 02:04:00 tom Exp $)dnl
dnl
dnl Emit some text.
dnl
gcal_distname=gcal-`sed -e '/VERSION_NO/!d' -e 's/^.*"\(.*\)".*$/\1/' $srcdir/$ac_unique_file`
echo
echo "this is the automatic configuration step of $gcal_distname"
echo
echo " --enable-feature=DIGIT+DIGIT+... where DIGIT is 1...6"
echo
echo "(1) --enable-cath additional Catholic holidays."
echo "(2) --enable-debug includes some debugging code."
echo "(3) --enable-easci displaying using the extended ASCII character set."
echo "(4) --enable-ger defaults German texts, holidays and calendar style."
echo "(5) --enable-ushdy U.S. specific holidays."
echo "(6) --enable-exit127 on --help, --version and --license, terminate"
echo " with exit status 127, otherwise with 0."
echo
echo " --enable-greg-ref=YEAR year of Gregorian reform, either 1582 or 1752."
echo
echo " --disable-hls never use highlighting sequences."
echo " --disable-pager never use external or simple, internal pager feature."
echo " --disable-rc never use fixed date warnings feature."
echo " --disable-term never use libtermcap or libtermlib."
echo
echo "please wait..."
echo
dnl
dnl Checks for package options.
AC_MSG_CHECKING(for package options)
dnl
gcal_lang=English
dnl
gcal_arglist=
gcal_enabled=
gcal_implicit=
gcal_illegal_defined=
gcal_multiple_defined=
dnl
gcal_enable_cath=no
gcal_enable_debug=no
gcal_enable_easci=no
gcal_enable_ger=no
gcal_enable_ushdy=no
gcal_enable_exit127=no
dnl
gcal_enable_hls=yes
gcal_enable_pager=yes
gcal_enable_rc=yes
gcal_enable_term=yes
dnl
AC_ARG_ENABLE(feature,
[ --enable-feature=DIGIT+DIGIT+... where DIGIT is 1...6],
[gcal_feature=feature
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}+"
for gcal_arg in $enableval; do
case $gcal_arg in
1) gcal_feature=cath
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_cath" != yes; then
AC_DEFINE(USE_CATH)
gcal_enable_cath=yes
gcal_enabled="$gcal_enabled $gcal_feature"
else
gcal_multiple_defined="$gcal_feature"
fi;;
2) gcal_feature=debug
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_debug" != yes; then
AC_DEFINE(DEBUG)
gcal_enable_debug=yes
gcal_enabled="$gcal_enabled $gcal_feature"
else
gcal_multiple_defined="$gcal_feature"
fi;;
3) gcal_feature=easci
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_easci" != yes; then
AC_DEFINE(USE_EASC)
gcal_enable_easci=yes
gcal_enabled="$gcal_enabled $gcal_feature"
else
gcal_multiple_defined="$gcal_feature"
fi;;
4) gcal_feature=ger
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_ger" != yes; then
if test "$enable_ushdy" != yes; then
AC_DEFINE(USE_GER)
gcal_lang=German
gcal_enable_ger=yes
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_multiple_defined="$gcal_feature"
fi;;
5) gcal_feature=ushdy
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_ushdy" != yes; then
if test "$gcal_lang" != German; then
AC_DEFINE(USE_USHDY)
gcal_lang=American
gcal_enable_ushdy=yes
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_multiple_defined="$gcal_feature"
fi;;
6) gcal_feature=exit127
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_exit127" != yes; then
AC_DEFINE(EXIT_STAT_HLP, 127)
gcal_enable_exit127=yes
gcal_enabled="$gcal_enabled $gcal_feature"
else
gcal_multiple_defined="$gcal_feature"
fi;;
*) if test "$gcal_arg" = no; then
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
else
AC_MSG_RESULT(hmm... whats this??)
AC_MSG_RESULT()
if test "$gcal_arg" = yes; then
AC_MSG_ERROR(not --enable-feature=DIGIT+DIGIT... given - aborting...)
else
AC_MSG_ERROR(invalid --enable-feature=$gcal_arg given - aborting...)
fi
fi;;
esac
done
IFS="$ac_save_ifs"])
dnl
AC_ARG_ENABLE(cath,
[ (1) --enable-cath additional Catholic holidays.],
[gcal_feature=cath
if test "$enableval" = yes; then
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_cath" = yes; then
gcal_multiple_defined="$gcal_feature"
else
AC_DEFINE(USE_CATH)
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(debug,
[ (2) --enable-debug includes some debugging code.],
[gcal_feature=debug
if test "$enableval" = yes; then
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_debug" = yes; then
gcal_multiple_defined="$gcal_feature"
else
AC_DEFINE(DEBUG)
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(easci,
[ (3) --enable-easci displaying using the extended ASCII character set.],
[gcal_feature=easci
if test "$enableval" = yes; then
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_easci" = yes; then
gcal_multiple_defined="$gcal_feature"
else
AC_DEFINE(USE_EASC)
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(ger,
[ (4) --enable-ger defaults German texts, holidays and calendar style.],
[gcal_feature=ger
if test "$enableval" = yes; then
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_ger" = yes; then
gcal_multiple_defined="$gcal_feature"
else
AC_DEFINE(USE_GER)
gcal_lang=German
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(ushdy,
[ (5) --enable-ushdy U.S. specific holidays.],
[gcal_feature=ushdy
if test "$enableval" = yes; then
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_ushdy" = yes; then
gcal_multiple_defined="$gcal_feature"
else
AC_DEFINE(USE_USHDY)
if test "$gcal_lang" != German; then
gcal_lang=American
fi
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(exit127,
[ (6) --enable-exit127 on --help etc. terminate with exit status 127.],
[gcal_feature=exit127
if test "$enableval" = yes; then
gcal_arglist="$gcal_arglist $gcal_feature"
if test "$gcal_enable_exit127" = yes; then
gcal_multiple_defined="$gcal_feature"
else
AC_DEFINE(EXIT_STAT_HLP, 127)
gcal_enabled="$gcal_enabled $gcal_feature"
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(greg-ref,
[ --enable-greg-ref=YEAR year of Gregorian reform, either 1582 or 1752.],
[gcal_feature=greg-ref
gcal_invalid_year=no
gcal_got_year=yes
if test "$enableval" != no; then
changequote(<<, >>)dnl
gcal_gr=`echo $enableval | sed -e 's/[^0-9]//g' -e 's/^0+/*/g'`
changequote([, ])dnl
if test "$gcal_gr" = "$enableval"; then
if test -n "$gcal_gr"; then
if test "$gcal_gr" -gt "0"; then
if test "$gcal_gr" -eq "1582" || test "$gcal_gr" -eq "1752"; then
AC_DEFINE_UNQUOTED(GREG_${gcal_gr})
gcal_enabled="$gcal_enabled $gcal_feature=$gcal_gr"
gcal_arglist="$gcal_arglist $gcal_feature=$gcal_gr"
else
gcal_invalid_year=yes
fi
else
gcal_invalid_year=yes
fi
else
gcal_invalid_year=yes
fi
else
if test "$enableval" != yes; then
gcal_invalid_year=yes
else
gcal_got_year=no
fi
fi
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi
if test "$gcal_invalid_year" = yes || test "$gcal_got_year" = no; then
AC_MSG_RESULT(hmm... whats this??)
AC_MSG_RESULT()
if test "$gcal_got_year" = no; then
AC_MSG_ERROR(not $gcal_feature=YEAR given - aborting...)
else
AC_MSG_ERROR(invalid YEAR $enableval to $gcal_feature given - aborting...)
fi
fi])
dnl
AC_ARG_ENABLE(hls,
[ --disable-hls never use highlighting sequences.],
[gcal_feature=hls
gcal_enable_hls=$enableval
if test "$gcal_enable_hls" = no; then
gcal_enabled="$gcal_enabled NO-$gcal_feature"
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(pager,
[ --disable-pager never use external or simple, internal pager feature.],
[gcal_feature=pager
gcal_enable_pager=$enableval
if test "$gcal_enable_pager" = no; then
gcal_enabled="$gcal_enabled NO-$gcal_feature"
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(rc,
[ --disable-rc never use fixed date warnings feature.],
[gcal_feature=rc
gcal_enable_rc=$enableval
if test "$gcal_enable_rc" = no; then
gcal_enabled="$gcal_enabled NO-$gcal_feature"
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
AC_ARG_ENABLE(term,
[ --disable-term never use libtermcap or libtermlib.],
[gcal_feature=term
gcal_enable_term=$enableval
if test "$gcal_enable_term" = no; then
gcal_enabled="$gcal_enabled NO-$gcal_feature"
else
gcal_illegal_defined="$gcal_illegal_defined $gcal_feature"
fi])
dnl
gcal_feature=hls
if test "$gcal_enable_hls" = yes; then
gcal_implicit="$gcal_implicit $gcal_feature"
AC_DEFINE(USE_HLS)
fi
dnl
gcal_feature=pager
if test "$gcal_enable_pager" = yes; then
gcal_implicit="$gcal_implicit $gcal_feature"
AC_DEFINE(USE_PAGER)
fi
dnl
gcal_feature=rc
if test "$gcal_enable_rc" = yes; then
gcal_implicit="$gcal_implicit $gcal_feature"
AC_DEFINE(USE_RC)
fi
dnl
gcal_feature=term
if test "$gcal_enable_term" = yes; then
gcal_implicit="$gcal_implicit $gcal_feature"
fi
dnl
if test -n "$gcal_illegal_defined" || test -n "$gcal_multiple_defined"; then
AC_MSG_RESULT(hmm... whats this??)
AC_MSG_RESULT()
if test -n "$gcal_illegal_defined"; then
AC_MSG_WARN(you have enabled/disabled features illegaly - see:)
AC_MSG_WARN()
AC_MSG_WARN($gcal_illegal_defined)
else
AC_MSG_WARN(you have enabled features twice or more - see:)
AC_MSG_WARN()
AC_MSG_WARN($gcal_arglist)
fi
AC_MSG_WARN()
AC_MSG_WARN(lets stop now so you can specify them correctly...)
exit 1
fi
dnl
if test -n "$gcal_enabled"; then
AC_MSG_RESULT(found: $gcal_enabled $gcal_implicit)
else
AC_MSG_RESULT(explicitly found: none)
AC_CHECK_PROG(LINE, line, line)
AC_MSG_WARN(NO --enable / --disable arguments given explicitly!)
AC_MSG_WARN(if this is OK then press RET to continue...)
AC_MSG_WARN(otherwise break with C-c and rerun with arguments...)
if test -n "$ac_cv_prog_LINE"; then
line >/dev/null
else
read gcal_kbd_input >/dev/null
fi
AC_MSG_RESULT(ok --- configuring with: $gcal_implicit)
fi
echo
echo "configuring for *** $gcal_lang *** users =8^)"
echo
lang=$gcal_lang
AC_SUBST(lang)dnl
dnl
dnl Checks for programs.
AC_CHECKING(for programs)
dnl
dnl Checks for makeinfo.
dnl
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo)
if test -z "$ac_cv_prog_MAKEINFO"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic recreation of text documentation/info files!)
AC_MSG_WARN(Makefile targets *txt* and *info* will never be executed.)
AC_MSG_RESULT()
else
AC_MSG_CHECKING(for makeinfo version)
changequote(<<, >>)dnl
AC_CACHE_VAL(gcal_cv_prog_MAKEINFO_VERSION,
gcal_cv_prog_MAKEINFO_VERSION=`makeinfo --version 2>&1 | sed -e 's/[^0-9]//g'`)
changequote([, ])dnl
gcal_makeinfo_error=no
if test -n "$gcal_cv_prog_MAKEINFO_VERSION"; then
AC_MSG_RESULT($gcal_cv_prog_MAKEINFO_VERSION)
if test "$gcal_cv_prog_MAKEINFO_VERSION" -lt "120"; then
gcal_makeinfo_error=yes
fi
else
gcal_makeinfo_error=yes
AC_MSG_RESULT(unknown)
fi
if test "$gcal_makeinfo_error" = yes; then
gcal_cv_prog_MAKEINFO_VERSION=
AC_MSG_RESULT()
AC_MSG_WARN(no automatic recreation of text documentation files!)
AC_MSG_WARN(the makeinfo program is out of date.)
AC_MSG_WARN(Makefile target *txt* will never be executed.)
AC_MSG_RESULT()
fi
MAKEINFOVERSION=$gcal_cv_prog_MAKEINFO_VERSION
AC_SUBST(MAKEINFOVERSION)dnl
fi
dnl
dnl Checks for texi2dvi.
dnl
AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi)
if test -z "$ac_cv_prog_TEXI2DVI"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of dvi files!)
AC_MSG_WARN(Makefile target *dvi* will never be executed.)
AC_MSG_RESULT()
fi
dnl
dnl Checks for shar.
dnl
AC_CHECK_PROGS(SHAR, gshar shar)
if test -z "$ac_cv_prog_SHAR"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of shared distribution!)
AC_MSG_WARN(Makefile target *distshar* will never be executed.)
AC_MSG_RESULT()
fi
dnl
dnl Checks for zip.
dnl
AC_CHECK_PROG(ZIP, zip, zip)
if test -z "$ac_cv_prog_ZIP"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of zipped distribution!)
AC_MSG_WARN(Makefile target *distzip* will never be executed.)
AC_MSG_RESULT()
fi
dnl
dnl Checks for zoo.
dnl
AC_CHECK_PROG(ZOO, zoo, zoo)
if test -z "$ac_cv_prog_ZOO"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of zooed distribution!)
AC_MSG_WARN(Makefile target *distzoo* will never be executed.)
AC_MSG_RESULT()
else
AC_CHECK_PROG(FIND, find, find)
if test -z "$ac_cv_prog_FIND"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of zooed distribution!)
AC_MSG_WARN(Makefile target *distzoo* will never be executed.)
AC_MSG_RESULT()
fi
fi
dnl
dnl Checks for lha.
dnl
AC_CHECK_PROGS(LHA, lha lharc)
if test -z "$ac_cv_prog_LHA"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of lhaed distribution!)
AC_MSG_WARN(Makefile target *distlha* will never be executed.)
AC_MSG_RESULT()
fi
dnl
dnl Checks for archivers (gtar, tar) and compressors (gzip, compress).
dnl
AC_CHECK_PROGS(TAR, gtar tar)
if test -z "$ac_cv_prog_TAR"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of gzipped/compressed distribution!)
AC_MSG_WARN(Makefile target *dist* will never be executed.)
AC_MSG_RESULT()
else
AC_CHECK_PROG(GZIP, gzip, gzip)
if test -z "$ac_cv_prog_GZIP"; then
AC_CHECK_PROG(COMPRESS, compress, compress)
fi
if test -z "$ac_cv_prog_GZIP" && test -z "$ac_cv_prog_COMPRESS"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic creation of gzipped/compressed distribution!)
AC_MSG_WARN(Makefile target *dist* will never be executed.)
AC_MSG_RESULT()
fi
fi
dnl
dnl Checks for text converters/interpeters (perl, awk).
dnl
AC_CHECK_PROG(PERL, perl, perl)
if test -z "$ac_cv_prog_PERL"; then
AC_PROG_AWK
if test -z "$ac_cv_prog_AWK"; then
AC_MSG_RESULT()
AC_MSG_WARN(no automatic installation of dates files!)
AC_MSG_WARN(Makefile target *installdates* will never be executed.)
AC_MSG_RESULT()
fi
fi
dnl
dnl Checks for pager programs (less, more).
dnl
AC_CHECK_PROG(PAGER1, less, less)
AC_CHECK_PROG(PAGER2, more, more)
AC_DEFINE_UNQUOTED(PAGER_PROG, "$PAGER1")
AC_DEFINE_UNQUOTED(PAGER2_PROG, "$PAGER2")
dnl
dnl Checks for install program/script.
dnl
AC_PROG_INSTALL
dnl
dnl Checks for C compiler.
AC_MSG_RESULT()
AC_CHECKING(for C compiler)
dnl
AC_PROG_CC
if test -z "$ac_cv_prog_CC"; then
AC_MSG_RESULT(hmm... whats this??)
AC_MSG_RESULT()
AC_MSG_ERROR(no C compiler found - aborting...)
fi
dnl
AC_PROG_GCC_TRADITIONAL
dnl
dnl Checks for operating system variants.
AC_MSG_RESULT()
AC_CHECKING(for operating system variants)
dnl
AC_AIX
AC_MINIX
AC_ISC_POSIX
dnl
dnl Checks for libraries.
AC_MSG_RESULT()
AC_CHECKING(for libraries)
dnl
if test "$gcal_enable_term" = yes; then
gcal_termcap_ok=no
gcal_termlib_ok=no
TERMLIBS=
AC_CHECK_LIB(termcap,
tgetent,
[AC_DEFINE(HAVE_LIBTERMCAP)
TERMLIBS="-ltermcap"])
AC_CHECK_LIB(termlib,
tgetent,
[have_termlib=yes],
[have_termlib=no])
dnl
dnl Solaris has termcap, but it don't work without libucb
dnl which is broken, so we use termlib.
dnl
AC_MSG_CHECKING(for working terminal libraries)
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
AC_TRY_LINK(,
[tgetent(0); tgetflag(0); tgetnum(0); tgetstr(0);],
[gcal_termcap_ok=yes])
if test "$gcal_termcap_ok" = yes; then
AC_MSG_RESULT(using $TERMLIBS)
else
TERMLIBS="-ltermlib"
LIBS="$SAVE_LIBS"
LIBS="$LIBS $TERMLIBS"
if test "$have_termlib" = yes; then
AC_TRY_LINK(,
[tgetent(0); tgetflag(0); tgetnum(0); tgetstr(0);],
[gcal_termlib_ok=yes])
if test "$gcal_termlib_ok" = yes; then
AC_DEFINE(HAVE_LIBTERMLIB)
AC_MSG_RESULT(using $TERMLIBS)
fi
fi
fi
if test "$gcal_termcap_ok" = no && test "$gcal_termlib_ok" = no; then
LIBS="$SAVE_LIBS"
AC_MSG_RESULT(hmm... whats this??)
AC_MSG_RESULT()
AC_MSG_WARN(no terminal libraries available)
AC_MSG_WARN()
AC_MSG_WARN(this means $gcal_distname will use its defaults now)
AC_MSG_WARN(and is unable to support several terminal types!)
AC_MSG_WARN(note: $gcal_distname would work more flexible if)
AC_MSG_WARN(libtermcap.a and/or libtermlib.a are installed.)
AC_MSG_RESULT()
fi
fi #Using termlibs
dnl
dnl Checks for header files.
AC_MSG_RESULT()
AC_CHECKING(for header files)
dnl
AC_STDC_HEADERS
AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h ctype.h assert.h signal.h fcntl.h)
AC_CHECK_HEADERS(termio.h termios.h sgtty.h)
if test "$gcal_enable_term" = yes; then
if test "$gcal_termcap_ok" = yes || test "$gcal_termlib_ok" = yes; then
AC_CHECK_HEADERS(termcap.h)
fi
fi #Using termlibs
AC_CHECK_HEADERS(sys/ioctl.h sys/stream.h sys/ptem.h sys/types.h sys/time.h)
AC_HEADER_SYS_WAIT
dnl
dnl Checks for typedefs.
AC_MSG_RESULT()
AC_CHECKING(for typedefs)
dnl
AC_TYPE_PID_T
AC_MSG_CHECKING(for time_t)
AC_CACHE_VAL(gcal_cv_type_time_t,
AC_TRY_COMPILE([
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif],
[time_t t = 0;],
[gcal_cv_type_time_t=yes],
[gcal_cv_type_time_t=no]))
if test "$gcal_cv_type_time_t" = yes; then
AC_DEFINE(HAVE_TIME_T)
fi
AC_MSG_RESULT($gcal_cv_type_time_t)
dnl
dnl Checks for structures.
AC_MSG_RESULT()
AC_CHECKING(for structures)
dnl
AC_HEADER_TIME
dnl
dnl Checks for compiler characteristics.
AC_MSG_RESULT()
AC_CHECKING(for compiler characteristics)
dnl
AC_C_CONST
dnl
AC_MSG_CHECKING(for void)
AC_CACHE_VAL(gcal_cv_c_void,
AC_TRY_COMPILE(,
[void *foo = 0;],
[gcal_cv_c_void=yes],
[gcal_cv_c_void=no]))
if test "$gcal_cv_c_void" = yes; then
AC_DEFINE(HAVE_VOID)
fi
AC_MSG_RESULT($gcal_cv_c_void)
dnl
dnl Checks for library functions.
AC_MSG_RESULT()
AC_CHECKING(for library functions)
dnl
AC_CHECK_FUNCS(dup dup2 strtol strstr strchr strrchr)
dnl
dnl Some systems have termios.h but not the corresponding functions.
dnl
AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS))
dnl
dnl Checks for ctype functions.
AC_MSG_RESULT()
AC_CHECKING(for ctype library functions)
dnl
AC_MSG_CHECKING(for isdigit)
AC_CACHE_VAL(gcal_cv_func_isdigit,
AC_TRY_LINK([
#if HAVE_CTYPE_H
# include <ctype.h>
#endif],
[static int x; x = isdigit(x);],
[gcal_cv_func_isdigit=yes],
[gcal_cv_func_isdigit=no]))
if test "$gcal_cv_func_isdigit" = yes; then
AC_DEFINE(HAVE_ISDIGIT)
fi
AC_MSG_RESULT($gcal_cv_func_isdigit)
dnl
AC_MSG_CHECKING(for isalnum)
AC_CACHE_VAL(gcal_cv_func_isalnum,
AC_TRY_LINK([
#if HAVE_CTYPE_H
# include <ctype.h>
#endif],
[static int x; x = isalnum(x);],
[gcal_cv_func_isalnum=yes],
[gcal_cv_func_isalnum=no]))
if test "$gcal_cv_func_isalnum" = yes; then
AC_DEFINE(HAVE_ISALNUM)
fi
AC_MSG_RESULT($gcal_cv_func_isalnum)
dnl
AC_MSG_CHECKING(for upper/lower)
AC_CACHE_VAL(gcal_cv_func_upper_lower,
AC_TRY_LINK([
#if HAVE_CTYPE_H
# include <ctype.h>
#endif],
[static int x; x = tolower(x); x = toupper(x); x = islower(x); x = isupper(x);],
[gcal_cv_func_upper_lower=yes],
[gcal_cv_func_upper_lower=no]))
if test "$gcal_cv_func_upper_lower" = yes; then
AC_DEFINE(HAVE_UPPER_LOWER)
fi
AC_MSG_RESULT($gcal_cv_func_upper_lower)
dnl
dnl Checks for external variable ospeed in the termcap/termlib library.
AC_MSG_RESULT()
AC_CHECKING(for external variables)
dnl
if test "$gcal_enable_term" = yes; then
if test "$gcal_termcap_ok" = yes || test "$gcal_termlib_ok" = yes; then
if test "$gcal_termcap_ok" = yes; then
AC_MSG_CHECKING(termcap for ospeed)
else
AC_MSG_CHECKING(termlib for ospeed)
fi
AC_CACHE_VAL(gcal_cv_var_ospeed_test_1,
AC_TRY_LINK([
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_TERMIOS_H
# include <termios.h>
#endif
#if HAVE_TERMCAP_H
# include <termcap.h>
#endif],
[ospeed = 0;],
[gcal_cv_var_ospeed_test_1=yes],
[gcal_cv_var_ospeed_test_1=no]))
if test "$gcal_cv_var_ospeed_test_1" = no; then
AC_CACHE_VAL(gcal_cv_var_ospeed_test_2,
AC_TRY_LINK(,
[extern short ospeed; ospeed = 0;],
[gcal_cv_var_ospeed_test_2=yes],
[gcal_cv_var_ospeed_test_2=no]))
fi
if test "$gcal_cv_var_ospeed_test_1" = yes || test "$gcal_cv_var_ospeed_test_2" = yes; then
AC_DEFINE(HAVE_OSPEED)
if test "$gcal_cv_var_ospeed_test_2" = yes; then
AC_DEFINE(MUST_DCL_OSPEED)
fi
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
fi #Using termlibs
dnl
dnl Checks for system services.
AC_MSG_RESULT()
AC_CHECKING(for system services)
dnl
AC_SYS_INTERPRETER
if test "$ac_cv_sys_interpreter" = yes; then
AC_DEFINE(HAVE_SYS_INTERPRETER)
fi
dnl
dnl Ending operations.
dnl
AC_MSG_RESULT()
AC_SUBST(CFLAGS)dnl
AC_OUTPUT(Makefile)dnl
dnl
dnl After all, create the timestamp file
dnl
echo timestamp > stamp-h
dnl
dnl Emit some text.
dnl
echo
echo "Bored? Fallen asleep?? All checks done!"
echo
echo "Perhaps you might want to inspect the created"
echo "Makefile now for tuning some settings..."
echo